{% extends 'admin/layout.html.twig' %}
{% set menu = 'admin_operation_wechat_fans_list' %}

{% block main %}
<form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
  <div class="form-group">

    <select class="form-control" name="weChatFansType">
        {{ select_options(dict('weChatFansType'), app.request.query.get('weChatFansType') ? app.request.query.get('weChatFansType') : 'all') }}
    </select>
  </div>
  <div class="form-group">
    <select id="weChatFansKeywordType" name="weChatFansKeywordType" class="form-control">
        {{ select_options(dict('weChatFansKeywordType'), app.request.query.get('weChatFansKeywordType') ? app.request.query.get('weChatFansKeywordType') : 'nickname') }}
    </select>
  </div>
  <div class="form-group">
    <input type="text" id="keyword" name="keyword" class="form-control" value="{{ app.request.query.get('keyword') }}" placeholder="{{ 'wechat.notification.fans_list.placeholder'|trans }}">
  </div>
  <button class="btn btn-primary">{{ 'wechat.notification.form.btn.search_submit_btn'|trans }}</button>

  <a class="gray-primary pull-right ptm" href="javascript:;" data-url="" data-toggle="tooltip" data-placement="top" title="{{ 'wechat.notification.fans_list.tips'|trans }}"><i class="glyphicon glyphicon-question-sign text-muted"></i></a>
</form>
<p class="text-muted"><span class="mrl">{{ 'wechat.notification.fans_list.user_num'|trans }}<strong class="inflow-num">{{ currentNum|default(0) }}</strong></span></p>
<table class="table table-striped table-hover" id="notification-table" style="word-break:break-all;">
  <thead>
    <tr>
      <th width="20%">{{ 'wechat.notification.fans_list.profile_picture'|trans }}</th>
      <th width="40%">{{ 'wechat.notification.fans_list.nickname'|trans }}</th>
      <th width="20%">{{ 'wechat.notification.fans_list.username'|trans }}</th>
      <th width="20%">{{ 'wechat.notification.fans_list.subscribe_time'|trans}}</th>
    </tr>
  </thead>
  <tbody>
    {% if not wechatSetting.wechat_notification_enabled|default(false) %}
      <tr>
        <td colspan="20">
          <div class="empty">{{'wechat.notification.fans_list.no_wechat_bind'|trans}}</div>
        </td>
      </tr>
    {% else %}
      {% for fan in fans %}
        {% include 'admin/wechat-notification/fans-tr.html.twig' %}
      {% else %}
        <tr>
          <td colspan="20">
            <div class="empty">{{'wechat.notification.fans_list.fans_list_empty'|trans}}</div>
          </td>
        </tr>
      {% endfor %}
    {% endif %}
  </tbody>
</table>
  {{ admin_macro.paginator(paginator) }}
{% endblock %}
